<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core3" prefix="select"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/dict" prefix="dict" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!-- search area   -->
<div class="row searchLineWrap">
	<form class="form-horizontal" method="post" action="getUsersByCondition" id="searchForm">
		  <div class="row">
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="user.login.userName"/></label>
		         <div class="col-md-8">
		            <input type="text" class="form-control" name="userName" placeholder="<s:text name="user.login.userName"/>"/>
		         </div>
		       </div>
		    </div>
	    
			<div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="user.userManager.nickname"/></label>
		         <div class="col-md-8">
		         	<input type="text" class="form-control" name="nickname" placeholder="<s:text name="user.userManager.nickname"/>"/>
		         </div>
		       </div>
		    </div>
		    
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="user.userManager.sex"/></label>
		         <div class="col-md-8">
		         	<select:select attrName="sex" enumWord="sex" cssClass="form-control"  language="${language }"/>
		         </div>
		       </div>
		    </div>
		    
		  </div>
		  
		  <div class="row">
			<div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="user.userManager.email"/></label>
		         <div class="col-md-8">
		         	<input type="text" class="form-control" name="email" placeholder="<s:text name="user.userManager.email"/>"/>
		         </div>
		       </div>
		    </div>
		    
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="user.userManager.phone"/></label>
		         <div class="col-md-8">
		         	<input type="text" class="form-control" name="phone" placeholder="<s:text name="user.userManager.phone"/>"/>
		         </div>
		       </div>
		    </div>
		    
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-4 control-label"><s:text name="common.createtime"/></label>
		         <div class="col-md-8">
		            <input type="text"  class="laydate-icon form-control layer-date" onclick="laydate()" name="createtime" placeholder="<s:text name="common.createtime"/>"/>
		         </div>
		       </div>
		    </div>
		  </div>
		  
		  <div class="row">
			<div class="col-md-12">
		      <div class="form-group" >
		      	
		      	<label  class="col-md-10 control-label"></label>
		         <div class="col-md-2">
		         	<button type="button" class="btn btn-primary pull-left" onclick="ajaxForm('content','searchForm')">
		          	<i class="fa fa-search m-l-sm m-r-xs"></i><s:text name="common.search"/></button>
		         </div>
		        </div>
		    </div>
		 </div>
		  
	</form>
</div>
<!-- search area end  -->

<div class="row searchLineWrap">
		<p><a href="javascript:void(0);" onClick="ajaxContent('redirectPage');" class="btn btn-primary pull-left"><s:text name="user.userManager.addUser"/></a><div class="clearfix"></div></p>
	<table class="table table-bordered table-hover dataTables-example">
	    <thead>
	        <tr>
	            <th><s:text name="user.login.userName"/></th>
	            <th><s:text name="user.userManager.nickname"/></th>
	            <th><s:text name="user.userManager.sex"/></th>
	            <th><s:text name="user.userManager.email"/></th>
	            <th><s:text name="user.userManager.phone"/></th>
	            <th><s:text name="user.userManager.usertype"/></th>
	            <th><s:text name="common.createtime"/></th>
	            <th><s:text name="common.updatetime"/></th>
	            <th><s:text name="common.operate"/></th>
	        </tr>
	    </thead>
	    <tbody>
	    	<s:iterator value="#request.users">
	    		<tr>
	    			<td>${userName }</td>
	    			<td>${nickname }</td>
	    			<td>
	    				<dict:dict code="${sex }" enumword="sex" language="${language}"/>
	    			</td>
	    			<td>${email }</td>
	    			<td>${phone }</td>
	    			<td><dict:dict code="${roleID }" enumword="usertype" language="${language}"/></td>
	    			<td><fmt:formatDate value="${createtime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	    			<td><fmt:formatDate value="${updatetime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	    			<td>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('viewUser?userID=${userID}');"><s:text name="common.view"/></button>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('getUserById?userID=${userID}')"><s:text name="common.edit"/></button>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxDelete('deleteUser?userID=${userID}','content')"><s:text name="common.delete"/></button>
					</td>
	    		</tr>
	    	</s:iterator>
	    </tbody>
	</table>
</div>

